package cn.ecnu.pojo.resume;

import cn.ecnu.common.validated.InsertGroup;
import cn.ecnu.common.validated.UpdateGroup;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@TableName(value = "resume_edu")
/* 求职者-教育经历 */
public class ResumeEdu {

    @TableId(value = "edu_id", type = IdType.AUTO)
    @NotNull(message = "eduId不能为空", groups = UpdateGroup.class)
    private Integer eduId;

    @NotNull(message = "userId不能为空", groups = InsertGroup.class)
    private Integer userId;

    @NotBlank(message = "学校名称不能为空")
    private String school;

    @NotBlank(message = "主修专业不能为空")
    private String major;

    private Integer qualification;

    private Integer eduType;

    @NotBlank(message = "学校所在地不能为空")
    private String eduLocation;

    private String eduDetail;

    @JsonFormat(pattern = "yyyy-MM")
    @NotNull(message = "起始时间不能为空")
    private Date eduStart;

    @JsonFormat(pattern = "yyyy-MM")
    @NotNull(message = "终止时间不能为空")
    private Date eduEnd;
}
